<!--户口查询-->
<template>
  <default-layout>
    <header-back text="户口查询" slot="header"></header-back>
    <div class="form-list" slot="main">
      <div class="form-list-item">
        <span class="label">姓名：</span>
        <span class="content">{{userInfo.aac003}}</span>
      </div>
      <div class="form-list-item">
        <span class="label">档案号：</span>
        <span class="content">{{userInfo.archiveCode}}</span>
      </div>
      <div class="form-list-item">
        <span class="label">身份证号：</span>
        <span class="content">{{userInfo.idCard}}</span>
      </div>
      <div class="form-list-item">
        <span class="label">户籍所在地：</span>
        <span class="content">{{list.storageStatus ? '郑州市丰产路派出所' : '--'}}</span>
      </div>
      <div class="form-list-item">
        <span class="label">在库状态：</span>
        <span class="content">{{list.storageStatus || '--'}}</span>
      </div>
      <div class="form-list-item">
        <span class="label">户口办理进度：</span>
        <span class="content">{{list.residenceStatus || '--'}}</span>
      </div>
    </div>
  </default-layout>
</template>
<script>
  import HeaderBack from '../../../components/header-back/header-back.vue'
  import DefaultLayout from '../../../layouts/default-layout/default-layout'
  import {http} from '../../../common/js/util'
  import {mapGetters} from 'vuex'
  export default {
    components: {DefaultLayout, HeaderBack},
    data() {
      return {
        list: {}
      }
    },
    computed: {
      ...mapGetters([
        'userInfo'
      ])
    },
    methods: {
      upInfo() {
        http({
          method: 'post',
          url: '/admin/person/sapi/residence/get/info/query',
          data: {
            name: this.userInfo.aac003,
            cardID: this.userInfo.idCard,
            fileNo: this.userInfo.archiveCode
          },
          tip: false
        }).then(res => {
          if (res.result === 1) {
            this.list = res.result
          } else {
            this.$message.alert(res.message)
          }
        }).catch(err => {
          err.message && this.$message.alert('您的户口信息不存在').then(() => {
            this.$router.back()
          })
        })
      }
    },
    mounted() {
      this.upInfo()
    }
  }
</script>
<style lang="scss" scoped>
  @import "../../../common/style/variable";
</style>
